const Dictionary = require("../../model/dictionary.model");
const User = require("../../model/user.model");
const Classify = require("../../model/classify.model");
const Resource = require("../../model/resource.model");
const Sequelize = require("sequelize");
class StatisticalChartTableService {
  async getStatisticalChartTable() {
    const { count: dictionaryCount } = await Dictionary.findAndCountAll();
    const { count: userCount } = await User.findAndCountAll();
    const { count: schoolboyCount } = await User.findAndCountAll({where:{gender:0}});
    const { count: schoolgirlCount } = await User.findAndCountAll({where:{gender:1}});
    const { count: unknownGenderCount } = await User.findAndCountAll({where:{gender:2}});
    const { count: classifyCount } = await Classify.findAndCountAll();
    const { count: navigationStationCount } = await Resource.findAndCountAll();
    return { dictionaryCount, userCount, classifyCount, navigationStationCount,schoolboyCount,schoolgirlCount,unknownGenderCount };
  }
}

module.exports = new StatisticalChartTableService();
